package com.coisshi.base.common.exception;


import lombok.Getter;

/**
 * 业务异常
 */
@Getter
public class BizException extends RuntimeException {
    private final int code;
    private final String message;

    public BizException(String message) {
        super(message);
        this.code = 400; // 默认业务错误码
        this.message = message;
    }

    public BizException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }
}

